package com.zian.domain.po;


import com.baomidou.mybatisplus.annotation.*;


import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.zian.enums.GenderEnum;
import com.zian.enums.IsDeletedEnum;
import com.zian.enums.LockedEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author
 * @since 2024-09-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_admin_user")
@ApiModel(description = "SysAdminUser对象")
public class SysAdminUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("管理员id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty( "管理员登陆名称")
    private String username;

    @ApiModelProperty( "管理员登陆密码")
    @JsonIgnore // 序列化的时候忽略掉该字段
    private String password;

    @ApiModelProperty( "管理员显示昵称")
    private String nickName;

    @ApiModelProperty( "手机号码")
    private String phone;

    @ApiModelProperty("性别 1 男 2女")
    private GenderEnum gender;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("是否锁定 0未锁定 1已锁定无法登陆")
    private LockedEnum locked;

    @ApiModelProperty("是否删除 0-未删除 1-已删除")
    @TableLogic
    private IsDeletedEnum isDeleted;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private Date expireTime;


}
